package com.ms.service.module.fish.message.server;

import java.nio.ByteBuffer;

import com.ms.service.module.fish.game.GameUser;
import com.ms.service.module.fish.message.FishBaseMessage;
import com.ms.service.module.fish.utils.GoConstant;

/**
 * 锁定攻击
 * @author cuiwm
 */
public class LockAttackMessage extends FishBaseMessage {
	
	private GameUser user;
	private int lostCoin;
	private int scriptId;
    
    public LockAttackMessage(GameUser user,int lostCoin,int scriptId) {
    	this.setUser(user);
    	this.setLostCoin(lostCoin);
    	this.setScriptId(scriptId);
	}

	public GameUser getUser() {
		return user;
	}

	public void setUser(GameUser user) {
		this.user = user;
	}

	public int getLostCoin() {
		return lostCoin;
	}

	public void setLostCoin(int lostCoin) {
		this.lostCoin = lostCoin;
	}

	public int getScriptId() {
		return scriptId;
	}

	public void setScriptId(int scriptId) {
		this.scriptId = scriptId;
	}

	@Override
	public void writeBody(ByteBuffer buf) {
		writeString(buf, user.getId().toString());
		buf.put((byte) GoConstant.BATTERY_TYPE_1);
		buf.putInt(lostCoin);
		buf.putInt(scriptId);
	}


}